package DAO;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import javax.swing.JOptionPane;

/**
 *
 * @author Storm^^Rain
 */
public class Configs {

    public static final String CONFIG_FILENAME = "configs.txt";
    private static String Connect;

    public static boolean loadConfigurations() {
        FileInputStream fis = null;
        if (new File(CONFIG_FILENAME).exists()) {
            try {
                BufferedReader buff = new BufferedReader(new FileReader(CONFIG_FILENAME));
                String line;
                while ((line = buff.readLine()) != null) {
                    Connect = line;
                }
                ConnectionDB.connect(Connect);
            } catch (Exception ex) {
                return false;
            }
        } else {
            JOptionPane.showMessageDialog(null, "You must run file Install first");
            System.exit(0);
        }

        return true;
    }
}
    

